<?php
// class Student{
//     public static $name="张三";
//     static public function show(){
//         echo "我是一个静态方法";
//     }
// }

// echo Student::$name;
// Student::show();
class Student{
    private static $num=0;
    public function __construct()
    {
        self::$num++;
    }
    public function __destruct()
    {
        self::$num--;
    }
    public function show(){
        echo "在线人数：".self::$num;
    }
}
$stu1=new Student();
$stu2=new Student();
$stu3=new Student();
$stu3->show();
unset($stu1);
$stu3->show();
?>